home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 54 / 054.d81 / vcr library (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  12KB  |  415 lines

  1. 20 rem poke788,52:rem disable run/stop
  2. 30 rem trasmart software
  3. 40 rem vcr library
  4. 50 gosub3830:goto620
  5. 60 rem --------------------------- bell
  6. 70 s=54272:pokes+1,112:pokes+5,10:pokes+6,9:pokes+24,15:pokes+4,17:pokes+4,16
  7. 80 return
  8. 90 rem ------------------ title screen
  9. 100 l=len(k$):m=38-l/2:fori=1tolen(k$)-19
  10. 110 printl$spc(m)left$(k$,i)right$(k$,l-(l-i)):m=m-1:next:return
  11. 120 rem ---------------------- directory
  12. 130 sys49152
  13. 140 print"[147]     [158]q to quit  [158]p to pause / resume"
  14. 150 open8,8,0,"$0:*=r"
  15. 160 get#8,a$,b$:n$=chr$(0)
  16. 170 get#8,a$,b$:ifb$=""then260
  17. 180 get#8,a$,b$:a=asc(a$+n$):b=asc(b$+n$)
  18. 190 c$=mid$(str$(a+256*b),2)+chr$(32)
  19. 200 print"       ";
  20. 210 printc$;:get#8,c$:ifc$<>""then210
  21. 220 print:getk$:ifk$="p"ork$="q"then240
  22. 230 getk$
  23. 240 ifk$="p"thenwait197,1:goto230
  24. 250 ifk$<>"q"then170
  25. 260 close8
  26. 270 print"[156]press space to continue[146]"
  27. 280 s=54272:pokes+1,112:pokes+5,10:pokes+6,9:pokes+24,15:pokes+4,17:pokes+4,16
  28. 290 ifpeek(203)<>60then290
  29. 300 goto780
  30. 310 rem -------------------- input data
  31. 320 poke198,0:y$="":z$=""
  32. 330 print"[156]_[157][146]";
  33. 340 forn=1to75 :getz$:ifz$<>""then380
  34. 342 next
  35. 350 print"_[157]";
  36. 360 forn=1to75 :getz$:ifz$<>""then380
  37. 362 next
  38. 370 getz$:ifz$=""then330
  39. 380 l=len(y$)
  40. 390 ifz$=chr$(13)andre=1thenprint"[156][157] ":return
  41. 400 ifz$=chr$(13)thenprint"[157] ":return
  42. 410 ifz$=chr$(20)andlandre=1thenprint"[156] [157][157]";:y$=left$(y$,l-1):goto330
  43. 420 ifz$=chr$(20)andlthenprint" [157][157]";:y$=left$(y$,l-1):goto330
  44. 430 ifhl=2orhl=19thenif(z$<"a"orz$>"z")andz$<>" "and(z$<"0"orz$>"9")then330
  45. 440 ifhl=1orhl=3orhl=4thenif(z$<"0"orz$>"9")andz$<>" "then330
  46. 450 ifl>=hlthen330
  47. 460 ifre=1thenprint"[156]";z$;:y$=y$+z$:goto330
  48. 470 printz$;:y$=y$+z$
  49. 480 goto330
  50. 490 rem --------------------- error chk
  51. 500 input#15,e,e$,a,b
  52. 510 ife=0ore=73thenreturn
  53. 520 ife=50thenreturn
  54. 530 print"there is an i/o problem"
  55. 540 print"error # is";e;" ";e$
  56. 550 print"track";a;"; sector";b
  57. 560 close8:close15
  58. 570 print"[156]press space to continue[146][145][145]";
  59. 580 ifpeek(203)=64then580
  60. 590 ifpeek(203)<>60then580
  61. 600 goto780
  62. 610 close8:close15:end
  63. 620 rem ------------------------ start
  64. 630 h=0
  65. 640 sp$="                                       "
  66. 650 open15,8,15,"i0":close15
  67. 660 gosub3100
  68. 670 ll$=chr$(13)
  69. 680 ln=40
  70. 690 open15,8,15
  71. 700 gosub490
  72. 710 close8:close15
  73. 720 k$="[152][221]        instructions (y/n)        [221]":l$=l$+"":gosub100
  74. 730 poke198,0
  75. 740 ifpeek(203)=64then740
  76. 750 ifpeek(203)=39then780
  77. 760 ifpeek(203)=25thenis=1:gosub2760:goto780
  78. 770 goto730
  79. 780 sys49152
  80. 790 print"[147][156][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]";
  81. 800 print"[221] r[156]ead a tape";
  82. 810 print"  w[156]rite a tape";
  83. 820 print"  e[156]dit tape [221]";
  84. 830 print"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]";
  85. 840 print"[221] p[156]rint label";
  86. 850 print"  c[156]reate file";
  87. 860 print"   d[156]irectory [221]";
  88. 870 print"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]";
  89. 880 print"[221] h[156]elp screen";
  90. 890 print"  s[156]ee all files";
  91. 900 print" l[156]oadstar  [221]";
  92. 910 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][146]";
  93. 920 poke198,0
  94. 930 geta$:ifa$=""ora$=" "then930
  95. 940 gosub70
  96. 950 ifa$=chr$(80)ora$=chr$(87)ora$=chr$(82)then1020
  97. 960 ifa$=chr$(67)ora$=chr$(69)then1020
  98. 970 ifa$=chr$(76)then2400:rem l
  99. 980 ifa$=chr$(68)then120:rem d
  100. 990 ifa$=chr$(83)then3230:rem s
  101. 1000 ifa$=chr$(72)thenh=1:goto2760:rem h
  102. 1010 goto780
  103. 1020 print"[145][156][171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179][146]"
  104. 1030 print"[145][156][221]what tape number to                   [221][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
  105. 1040 print"[156][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][146]"
  106. 1050 print"[145][145][145]"spc(21);
  107. 1060 ifa$=chr$(80)thenprint"print ";
  108. 1070 ifa$=chr$(87)thenprint"write ";
  109. 1080 ifa$=chr$(82)thenprint"read ";
  110. 1090 ifa$=chr$(67)thenprint"create ";
  111. 1100 ifa$=chr$(69)thenprint"edit ";
  112. 1110 ifa$<chr$(65)ora$>chr$(90)then790
  113. 1120 re=1:hl=3:gosub320:v$=y$:re=0
  114. 1130 gosub70
  115. 1140 ifval(v$)<1thenprint"file # must be greater than 0"
  116. 1150 ifval(v$)>200thenprint"file # must be less than 200"
  117. 1160 ifval(v$)<1orval(v$)>200thenprint"[156]press space to continue[146]"
  118. 1170 ifval(v$)<1orval(v$)>200thenwait197,4:a$="":goto780
  119. 1180 vw=0
  120. 1190 ifa$=chr$(80)then2470:rem p
  121. 1200 ifa$=chr$(82)then1260:rem r
  122. 1210 ifa$=chr$(87)then1550:rem w
  123. 1220 ifa$=chr$(67)then1780:rem c
  124. 1230 ifa$=chr$(69)then1950:rem e
  125. 1240 goto780
  126. 1250 :
  127. 1260 rem -------------------------- read
  128. 1270 open15,8,15
  129. 1280 gosub490
  130. 1285 print#15,"r0:"+v$+"="+v$:input#15,er
  131. 1286 if er<>63 then printspc(13)"file is empty [156]":rn=8:goto1450
  132. 1290 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
  133. 1300 gosub490
  134. 1310 rn=1
  135. 1320 rem return here for line 2 - 7
  136. 1330 gosub2460
  137. 1340 print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
  138. 1350 gosub490
  139. 1360 input#8,aa$,bb$,cc$,dd$,ee$
  140. 1370 gosub490
  141. 1380 ifaa$="[255]"andrn=1thenprintspc(13)"file is empty [156]":rn=8:goto1450
  142. 1390 ifaa$="[255]"thenrn=8:goto1450
  143. 1400 ifcc$=""thencc$="      deleted[152]"
  144. 1410 ifrn=1thenprint"[156][221]       tape number ";v$;" contains "
  145. 1420 ifrn=1thenprint"[156][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][146]";
  146. 1430 ifrn=1thenprint"     title           rated  from  to[152]"
  147. 1440 printaa$+". "tab(3)cc$tab(23)bb$tab(28)dd$tab(33)ee$
  148. 1450 ifrn>=8andvw=1thenclose8:close15:return
  149. 1460 ifrn>=8thenprint"[156]press space to continue[146]"
  150. 1470 ifrn>=8thenclose8:close15
  151. 1480 ifrn>=8thengosub70
  152. 1490 ifrn>=8thenifpeek(203)<>60then1490
  153. 1500 ifrn>=8then1530
  154. 1510 rn=rn+1
  155. 1520 goto1320
  156. 1530 goto780
  157. 1540 :
  158. 1550 rem ------------------------ write
  159. 1560 open15,8,15
  160. 1570 gosub490
  161. 1580 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
  162. 1590 gosub490
  163. 1600 print"ready to write tape #";v$
  164. 1610 print"line# (1  chr max) ";:hl=1:gosub320:aa$=y$
  165. 1620 ifaa$=""thenprint"cancelled":forpa=1to800:nextpa:goto1760
  166. 1630 rn=val(aa$)
  167. 1640 ifrn>=8thenclose8:close15:goto780
  168. 1650 print"rated (2  chr max) ";:hl=2:gosub320:bb$=y$
  169. 1660 print"title (19 chr max) ";:hl=19:gosub320:cc$=y$
  170. 1670 print"from  (4  chr max) ";:hl=4:gosub320:dd$=y$
  171. 1680 print"to    (4  chr max) ";:hl=4:gosub320:ee$=y$
  172. 1690 rc$=aa$+ll$+bb$+ll$+cc$+ll$+dd$+ll$+ee$
  173. 1700 gosub2460
  174. 1710 print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
  175. 1720 gosub490
  176. 1730 if e=50 thenprint"the dos will expand the file now"
  177. 1740 print#8,rc$
  178. 1750 gosub490
  179. 1760 close8:close15:goto780
  180. 1770 :
  181. 1780 rem ------------------ create file
  182. 1790 print""
  183. 1800 print"setting up file...wait one moment"
  184. 1810 open15,8,15,"ui"
  185. 1820 gosub490
  186. 1830 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
  187. 1840 gosub490
  188. 1850 print""
  189. 1860 rn=7
  190. 1870 gosub2460
  191. 1880 print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
  192. 1890 gosub490
  193. 1900 if e<>50thenprint"file "v$" exists"
  194. 1910 if e=50 thenprint"writing blank file to disk now"
  195. 1920 print#8,chr$(255)
  196. 1930 gosub490
  197. 1940 close8:close15:goto780
  198. 1950 rem ------------------------- edit
  199. 1960 vw=1:gosub1260:vw=0
  200. 1970 open15,8,15
  201. 1980 gosub490
  202. 1990 open8,8,8,"0:"+(v$)+",